//
//  MVTableViewCell.m
//  23-QQ音乐
//
//  Created by dllo on 16/8/15.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "MVTableViewCell.h"
#import "MVCollectionViewCell.h"
#import "MVConllectionList.h"
#define kMVCollectionViewCell @"CollectionViewCell"
@interface MVTableViewCell ()<UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
@property (weak, nonatomic) IBOutlet UICollectionView *MVCollectionView;

@end

@implementation MVTableViewCell



- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
//        NSLog(@"%@",NSStringFromCGRect(self.bounds));
//            return CGSizeMake(100, 100);
            return CGSizeMake(CGRectGetWidth(collectionView.bounds), CGRectGetHeight(collectionView.bounds) / 2 - 15);
    }
    return CGSizeMake((CGRectGetWidth(collectionView.bounds) - 5) / 2, CGRectGetHeight(collectionView.bounds) / 4);
}





- (void)setMvListArray:(NSArray<MVConllectionList *> *)mvListArray
{
    _mvListArray = mvListArray;
    [_MVCollectionView reloadData];
}


- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return _mvListArray.count;
}


- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    MVCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kMVCollectionViewCell forIndexPath:indexPath];
    cell.myCollectionList = _mvListArray[indexPath.row];
    
    
    
    
    return cell;
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
